﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace Lawyer.Web
{
    public partial class activityshow : System.Web.UI.Page
    {
        public string strid = "";
        Lawyer.BLL.ArchiveInfo archiveBll = new Lawyer.BLL.ArchiveInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    string ActivityID = strid;
                    ShowInfo(ActivityID);
                }
            }
        }

        Lawyer.BLL.UserInfo userBll = new Lawyer.BLL.UserInfo();
        private void ShowInfo(string ActivityID)
        {
            Lawyer.BLL.ActivityInfo bll = new Lawyer.BLL.ActivityInfo();
            Lawyer.Model.ActivityInfo model = bll.GetModel(ActivityID);
            this.txtActivityName.Text = model.Title;
            this.txtActivityType.Text = model.Type;
            this.txtActivityDetails.Text = model.Detail;
            this.txtStartTime.Text = model.StartDate.ToString();
            this.txtEndTime.Text = model.EndDate.Value.ToString();
            this.txtFee.Text = model.Fee.ToString();
            Model.ArchiveInfo archive = archiveBll.GetModel(model.ArchiveID);
            if (archive == null)
            {
                this.txtArchive.Text = "No Archive related.";
            }
            else
            {
                this.txtArchive.Text = archive.Title;
            }
            Lawyer.Model.UserInfo user = userBll.GetModelFromUserID(model.CreatedBy);
            this.txtCreateBy.Text = user.FullName;
            this.txtCreateDate.Text = model.CreatedDate.ToString();
        }
    }
}
